Programming Erlang, Second Edition (for Lorinda Hartzler) by Joe Armstrong

Programming Erlang, Second Edition (for Lorinda Hartzler) by Joe Armstrong

Author:Joe Armstrong
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 978-1-937785-53-6
Publisher: The Pragmatic Bookshelf, LLC (448677)


Listing URLs from a File

Let’s write a simple function called urls2htmlFile(L, File) that takes a list of URLs, L, and creates an HTML file, where the URLs are presented as clickable links. This lets us play with the technique of creating an entire file in a single I/O operation. We’ll write our program in the module scavenge_urls. First here’s the program header:

scavenge_urls.erl

​ ​-module​(scavenge_urls).

​ ​-export​([urls2htmlFile/2, bin2urls/1]).

​ ​-import​(lists, [reverse/1, reverse/2, map/2]).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.